package com.hxht.storage.server.bean;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.hxht.storage.server.util.NvrBeanTransUtil;

public class RecordSearchResultBean {

	/** DVR设备IP地址 */
	private String ip;
	
	/** DVR设备端口 */
	private Integer port;
	
	/** DVR设备登陆用户名 */
	private String username;
	
	/** DVR设备登陆密码 */
	private String passwd;
	
	/** DVR设备 ip通道号 */
	private int ipchannel; 

	private List<TimePeriodBean> timePeriodList = new ArrayList<TimePeriodBean>();
	
	public void addTimePeriod(String deviceId, int deviceChannelIndex,
			Date startTime, Date stopTime, List<RecordMarkBean> recordMarks, String uuid){
		
		if (startTime == null || stopTime == null)
			return;
		// 判断 时间片段是否有效
		if (!startTime.before(stopTime))
			return;
		
		TimePeriodBean period = new TimePeriodBean();
		
		period.setDeviceChannelIndex(deviceChannelIndex);
		period.setDeviceId(deviceId);
		period.setRecordUuid(uuid);
		
		period.setStartTime(NvrBeanTransUtil.transDateToFormatString(startTime));
		period.setStopTime(NvrBeanTransUtil.transDateToFormatString(stopTime));
		period.setRecordMarks(recordMarks);
		
		timePeriodList.add(period);
	}
	
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public Integer getPort() {
		return port;
	}

	public void setPort(Integer port) {
		this.port = port;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPasswd() {
		return passwd;
	}

	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}

	public int getIpchannel() {
		return ipchannel;
	}

	public void setIpchannel(int ipchannel) {
		this.ipchannel = ipchannel;
	}

	public List<TimePeriodBean> getTimePeriodList() {
		return timePeriodList;
	}

	public void setTimePeriodList(List<TimePeriodBean> timePeriodList) {
		this.timePeriodList = timePeriodList;
	}

}
